How to calculate nth root of a number manually